import http from '../../../http/http'
import * as url from '../../../http/api'

const state = {

};
const actions ={
    selectTablePage({commit},obj){
         return http ({
             url:url.tableManagementPage,
             method:'post',
             data:obj,
         }).then(resp=>{
             return resp.data
         }).catch(err=>{
             console.log(err)
         })
    },
    selectTableStore({commit},obj){
        return http ({
            url:url.tableManagementSelect,
            method:'post',
            data:obj,
        }).then(resp=>{
           return resp.data
        }).catch(err=>{
            console.log(err)
        })

    },
    addTableStore({commit},obj){
        console.log(obj)
        return http({
            url:url.tableManagementAdd,
            method: 'post',
            data:obj,
        }).then(resp=>{
            return resp.data
        }).catch(err=>{
            console.log(err)
        })
    },
    updateTableStore({commit},obj){
        return http({
            url:url.tableManagementUpdate,
            method: 'post',
            data:obj,
        }).then(resp=>{
            return resp.data
        }).catch(err=>{
            console.log(err)
        })
    },
    deleteTableStore({commit},obj){
        return http({
            url:url.tableManagementDelete,
            method: 'post',
            data:obj,
        }).then(resp=>{
            return resp.data
        }).catch(err=>{
            console.log(err)
        })
    },
};
const mutations = {

};
export default{
    state,
    actions,
    mutations
}